Release 10.1A: OpenEdge Development:
Progress 4GL Reference


DELETE OBJECT statement

Deletes an instance of an object such as a widget, a procedure, a server, a socket, or a class. Deleting the object instance causes all allocated resources associated with the object instance to be returned to the system (except when otherwise noted).

Syntax

DELETE OBJECT { handle | object-reference } [ NO-ERROR ] 

handle

A handle to the object to delete. The handle argument must be a variable of type HANDLE and must contain a valid handle.

If the handle parameter refers to a widget handle, the DELETE OBJECT statement is a synonym for the DELETE WIDGET statement.

If the handle parameter refers to a persistent procedure handle or proxy persistent procedure handle, the DELETE OBJECT statement is a synonym for the DELETE PROCEDURE statement. This statement deletes a local persistent procedure handle immediately. For a proxy persistent procedure handle, this statement deletes
the handle immediately unless there is an outstanding asynchronous request on this
handle (handle:ASYNC-REQUEST-COUNT is greater than zero (0)). If handle:ASYNC-REQUEST-COUNT is greater than zero (0), this statement raises the ERROR condition. Otherwise, the statement also sends a request to the AppServer to delete the corresponding remote persistent procedure on the AppServer. If the AppServer is executing any asynchronous requests ahead of it, Progress queues the delete request (as with any asynchronous remote request) until the AppServer is available to handle it.

Note: This same behavior occurs if the remote procedure deletes itself (using DELETE...THIS-PROCEDURE) on the AppServer.

For more information on remote persistent procedures, see OpenEdge Application Server: Developing AppServer Applications .

If the handle parameter refers to a server handle, the DELETE OBJECT statement:

object-reference

An object reference for the class object instance to delete. The object reference argument must be an object reference variable, such as one defined using the DEFINE VARIABLE statement with the CLASS option, and must contain a valid object reference.

Note: You can validate an object reference by using the VALID-OBJECT function.

When you delete a class object instance, Progress invokes the destructor method for the class and the destructor method for each class in its inherited class hierarchy, if any. The destructor method is responsible for freeing resources allocated by the object instance when the object is deleted. At this time, the object instance context goes out of scope and all allocated resources are returned to the system. In addition, the object instance is removed from the list of valid object instances referenced by the FIRST-OBJECT and LAST-OBJECT attributes of the SESSION system handle.

If you do not delete a class object instance, the instance remains in memory until the session ends, and Progress does not invoke any destructor methods for the class.

NO-ERROR

Suppresses reporting of errors that occur while DELETE OBJECT executes. Afterwards, you can get information on possible errors by checking the ERROR-STATUS system handle.

Notes

See also

DELETE PROCEDURE statement, DELETE WIDGET statement, DESTRUCTOR statement, ERROR-STATUS system handle


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095